package com.yi.student.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotEmpty;

@Entity
@Table(name="t_rap")
public class RewardAndPubnish {
	private int id;	
	private String situation ;//奖励惩罚的情况	
	private int year ; //学年
	private String semester ; //学期
	private String cause ; //原因
	private Student stu ;
	
	//是否是奖励，1表示是，0表示不是
	private int isReward;
	
	
	@Column(name="is_reward")
	public int getIsReward() {
		return isReward;
	}
	public void setIsReward(int isReward) {
		this.isReward = isReward;
	}
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	@NotEmpty(message="奖励或惩处情况不能为空")
	public String getSituation() {
		return situation;
	}
	public void setSituation(String situation) {
		this.situation = situation;
	}
	
	@NotNull(message="学年不能为空")
	public int getYear() {
		return year;
	}
	public void setYear(int year) {
		this.year = year;
	}
	@NotEmpty(message="学期不能为空")
	public String getSemester() {
		return semester;
	}
	public void setSemester(String semester) {
		this.semester = semester;
	}
	@NotEmpty(message="原因不能为空")
	public String getCause() {
		return cause;
	}
	
	public void setCause(String cause) {
		this.cause = cause;
	}
	
	@ManyToOne
	@JoinColumn(name="uid")
	public Student getStu() {
		return stu;
	}
		
	public void setStu(Student stu) {
		this.stu = stu;
	}
	
	

}
